package com.smartlifev30.baiwei.fragment;


import android.support.v4.app.Fragment;

import com.smartlifev30.mvp.presenter.BasePresenter;

/**
 * A simple {@link Fragment} subclass.
 */
public abstract class BaseFragment<P extends BasePresenter> extends Fragment {

    protected P presenter;

    @Override
    public void onDestroy() {
        if(presenter != null){
            presenter.detach();
        }
        super.onDestroy();
    }

    protected abstract P createPresent();
}
